﻿<ResourceDictionary 
    x:Class="SoftWareBoot.BaseWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <Style x:Key="NoneBorderWindow">
        <Setter Property="Window.Background" Value="{x:Null}"/>
        <Setter Property="Window.WindowStyle" Value="None"/>
        <Setter Property="Window.AllowsTransparency" Value="True"/>
        <Setter Property="Window.Template" Value="{DynamicResource NoneBorderWindowTemplate}"/>
    </Style>
    <ControlTemplate x:Key="NoneBorderWindowTemplate" TargetType="{x:Type Window}">
        <Border Margin="6" BorderThickness="1" BorderBrush="DarkCyan" CornerRadius="5,5,5,5" Background="{DynamicResource WindowBackgroundBrush}">
            <AdornerDecorator>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <Border Grid.Row="0" Grid.Column="0" CornerRadius="2,2,0,0"  >
                    <TextBlock MouseMove="Title_MouseMove" Padding="5,4,0,0" Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window},Path=Title}" Foreground="{DynamicResource TextBrush}"/>
                    </Border>
                    <StackPanel Grid.Column="0"  Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Right">
                        <Button Name="Btn_Close" Height="16" Width="30"  Margin="2,2,5,2" Click ="btn_Click">
                            <Image Height="9" Width="11" Source="..\Image\Close.png"/>
                        </Button>
                    </StackPanel>
                    <Border Grid.Row="1" CornerRadius="2,2,5,5" BorderThickness="1" BorderBrush="DarkCyan"  Margin="3,0,3,3" >
                        <ContentPresenter />
                    </Border>
                </Grid>
            </AdornerDecorator>
        </Border>
    </ControlTemplate>

</ResourceDictionary>